package com.demo15;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class CopyCharDemo {
    public static void main(String[] args) throws IOException {
        //读取数据和赋值数据的点
        FileReader fr = new FileReader("idea_demo\\java\\VideoCopyStreamDemo.java");

        FileWriter fw = new FileWriter("idea_demo\\java\\Copy.java");

        //字符的形式读数据
//        int chr;
//        while ((chr=fr.read())!=-1){
//            fw.write(chr);
//        }

        char[] chars = new char[1024];
        int len;//长度，读取内容的长度
        while ((len=fr.read(chars))!=-1){
            fw.write(chars,0,len);
        }

        //关闭信息
        fw.close();
        fr.close();
    }
}
